using System;
using System.Data;
using System.Collections;
using APP.QUANLY.Common;

namespace RMAS.DAL
{
    /// <summary>
    /// Summary description for DM_UNIT.
    /// </summary>
    public class DM_UNIT
    {
              private string _ID;
      private string _Name;
      private string _Note;
      private string _IDPOS;
      private DM_MENUList _listDM_MENU;
        private bool isExisting;
        #region Properties
        public bool IsExisting
        {
              get{return isExisting;}
              set{isExisting = value;}
        }
	      public bool IsSetID; 
      public bool IsIDNullable   
      { 
	 get { return false;  } 
      }
      public string ID
      {
         get { return _ID; }
         set 
	    { 
 		 _ID = value;
		IsSetID = true;
 	    }
      }
    public bool IsSetName; 
    public bool IsNameNullable   
    { 
		get { return false;  } 
    }
    public string Name
    {
        get{ return _Name;  }
        set
		{
			_Name = value;
			IsSetName = true;
		}
    }
    public bool IsSetNote; 
    public bool IsNoteNullable   
    { 
		get { return false;  } 
    }
    public string Note
    {
        get{ return _Note;  }
        set
		{
			_Note = value;
			IsSetNote = true;
		}
    }
    public bool IsSetIDPOS; 
    public bool IsIDPOSNullable   
    { 
		get { return false;  } 
    }
    public string IDPOS
    {
        get{ return _IDPOS;  }
        set
		{
			_IDPOS = value;
			IsSetIDPOS = true;
		}
    }
public DM_MENUList DM_MENUList 
{ 
	get { return _listDM_MENU; }
	set { _listDM_MENU = value;}
}

        #endregion

        #region Constructors
        public DM_UNIT()
        {
            Reset();
        }
        public DM_UNIT(DM_UNIT obj)
        {
            	this._ID = obj.ID;
	this._Name = obj.Name;
	this._Note = obj.Note;
	this._IDPOS = obj.IDPOS;
        }
        #endregion

        public void Reset()
        {
                     _ID = EmptyValues.v_string;
         _Name = EmptyValues.v_string;
         _Note = EmptyValues.v_string;
         _IDPOS = EmptyValues.v_string;
	_listDM_MENU = null;
        }

         
        #region Hidden

        /*
        private void readProperties(IDataReader reader)
        {
            try
            {
                                if(!(reader["ID"] is DBNull))
		{
			obj.ID = (string)reader["ID"];
		}
                if(!(reader["Name"] is DBNull))
		{
			obj.Name = (string)reader["Name"];
		}
                if(!(reader["Note"] is DBNull))
		{
			obj.Note = (string)reader["Note"];
		}
                if(!(reader["IDPOS"] is DBNull))
		{
			obj.IDPOS = (string)reader["IDPOS"];
		}
//            _ID = (reader["ID"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["ID"];
//            _Name = (reader["Name"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Name"];
//            _Note = (reader["Note"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Note"];
//            _IDPOS = (reader["IDPOS"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["IDPOS"];
            }
            catch (Exception ex)
            {
                throw new DalException("Failed to read properties from DataReader.", ex);
            }
        } 
        */

        #endregion


        public void Fill(string ID, string Name, string Note, string IDPOS)
        {
                     this._ID = ID;
         this._Name = Name;
         this._Note = Note;
         this._IDPOS = IDPOS;
        }
    }
}